//--------------------------------------------------------------------------------
// This file is a portion of the D2D1Renderer.  It is distributed
// under the MIT License, available in the root of this distribution and 
// at the following URL:
//
// http://www.opensource.org/licenses/mit-license.php
//
// Copyright (c) Mirco Timmermann
//
//--------------------------------------------------------------------------------
#pragma once

#ifndef _KEYBOARDEVENT_H
#define _KEYBOARDEVENT_H

#include "..\Event.h"
#include <string>

#include <Windows.h>


class KeyboardEvent : public Event {
public:
	static const std::string KEY_DOWN;
	static const std::string KEY_UP;

	int _keyCode;
	char _charCode;
	bool _shiftKey;
	bool _strgKey;
	bool _altKey;

	KeyboardEvent(const std::string &type, int keyCode, bool shiftKey = false, bool strgKey = false, bool altKey = false, void* data = 0, bool bubbles = false, bool cancelable = false) : _keyCode(keyCode), Event(type, data, bubbles, cancelable) { 
		_keyCode = keyCode;
		_shiftKey = shiftKey;
		_strgKey = strgKey;
		_altKey = altKey;
	} // _ctrlKey = false; _altKey = false; _shiftKey = false; }

};

#endif

/*
* Example:
*
* void ON_KEY_UP(const Event &e) {
*	int key = (int)e.data;
*
*	if(key == DIK_D) {
*		//DO SOMETHING
*	}	
* }
*
*/
